Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Cloudsearch Index Fields name lenght restriction #38509

Merged

Conversation

ulyssedsn
Copy link
Contributor

@ulyssedsn ulyssedsn commented Jul 24, 2024

Description

This PR is to fix the impossibility to define a CloudSearch index field name with 1 or 2 characters. From the client, we can create index field name such as id or x (1 or 2 letter characters), however current validation enforces that field names must begin with a letter and be at least 3 characters.

Relations

Closes #35564

References

It is true that in the AWS documentation it is specified that "Regular index field names must begin with a letter and be at least 3 and no more than 64 characters long. The allowed characters are: a-z (lower-case letters), 0-9, and _ (underscore). The name score is reserved and cannot be specified as a field name. All field and expression names must be unique."
However, we could create index field names with 1 and 2-letter characters.

Output from Acceptance Testing

testacc TESTS="TestAccCloudSearchDomain_indexFields" PKG=cloudsearch
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.5 test ./internal/service/cloudsearch/... -v -count 1 -parallel 20 -run='TestAccCloudSearchDomain_indexFields'  -timeout 360m
=== RUN   TestAccCloudSearchDomain_indexFields
=== PAUSE TestAccCloudSearchDomain_indexFields
=== CONT  TestAccCloudSearchDomain_indexFields
--- PASS: TestAccCloudSearchDomain_indexFields (1932.69s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/cloudsearch        1985.764s

...

@ulyssedsn ulyssedsn requested a review from a team as a code owner July 24, 2024 14:16
Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@terraform-aws-provider terraform-aws-provider bot added documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/cloudsearch Issues and PRs that pertain to the cloudsearch service. size/XS Managed by automation to categorize the size of a PR. labels Jul 24, 2024
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome @ulyssedsn 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@ulyssedsn ulyssedsn force-pushed the b-cloudsearch_index_name_character_restriction branch from 394f742 to df64f3c Compare July 25, 2024 07:22
@jar-b
Copy link
Member

jar-b commented Jul 25, 2024

Hi @ulyssedsn - thanks for your submission!

The changes LGTM, but I'm working through some issues in our testing accounts with the CloudSearch service. I'll get this merged as soon as that is sorted and I can run acceptance tests.

@jar-b
Copy link
Member

jar-b commented Jul 29, 2024

It turns out AWS introduced a change which prevents accounts with no active CloudSearch domains from creating new ones.

We introduced a change on July 25, wherein new accounts that don't already have one or more CloudSearch domains, will have to be explicitly allowlisted for new domain creation.

As such, I can't run the full acceptance test suite in our testing accounts. I'm going to go ahead and merge this given the change is small, however, we ask for community feedback If any unexpected behavior is observed after the release of this functionality. Thanks!

Copy link
Member

@jar-b jar-b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@jar-b
Copy link
Member

jar-b commented Jul 29, 2024

Thanks for your contribution, @ulyssedsn! 👍

@jar-b jar-b merged commit 793714c into hashicorp:main Jul 29, 2024
41 checks passed
@github-actions github-actions bot added this to the v5.61.0 milestone Jul 29, 2024
Copy link

github-actions bot commented Aug 2, 2024

This functionality has been released in v5.61.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Copy link

github-actions bot commented Sep 1, 2024

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. service/cloudsearch Issues and PRs that pertain to the cloudsearch service. size/XS Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: AWS CloudSearch provider doesn't support field name "id"
2 participants